UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sKrm9eTTnfXmYO+QAmU5p9EsgS0Dbu9idifdJ9F6urU='
WHERE
key_id = 'fc73f5fbf696762c7999890aba7f2da884b9a31710f6b1a9dc9882afdb45babd'
AND (
token = 'sKrm9eTTnfXmYO+QAmU5p9EsgS0Dbu9idifdJ9F6urU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)