UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2T2TPuS2n5tEI3gZEJ7uraQ7AINyAummIZZpDDGK7no='
WHERE
key_id = '94e32dcfcc8fef5358defa920b3def888f62af080fcabce44f2912fc1788a431'
AND (
token = '2T2TPuS2n5tEI3gZEJ7uraQ7AINyAummIZZpDDGK7no='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)