UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yfWYmcp7CXLUNDfCMgcI+GJygmIBRWkCRR1JZ48zH7Y='
WHERE
key_id = '664781b3b98a8706f9ec70d1f4bca34080a4cdda550103f28e8a8035facced98'
AND (
token = 'yfWYmcp7CXLUNDfCMgcI+GJygmIBRWkCRR1JZ48zH7Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)