UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6URUOPfiNASJKHgDS27JYwIYKEdmjLQvu/lg/X0I0+4='
WHERE
key_id = '5b8afffe3b4a785cac729aa5fef41e8d29a7a56c218d6950f7998a56f8aa87dc'
AND (
token = '6URUOPfiNASJKHgDS27JYwIYKEdmjLQvu/lg/X0I0+4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)