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