UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hYKFC7eec5i4cob1Sr21ytO4x6ljIgHiB97CV9eIeKs='
WHERE
key_id = 'a903c9dc156db1314a9ce1aa0283996438c0b5500580cabff020c42365a2dcae'
AND (
token = 'hYKFC7eec5i4cob1Sr21ytO4x6ljIgHiB97CV9eIeKs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)