UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WSTs5sPBhPEcJc4eBIY5xO8jsEDgW2ZR2s8gGy+UC94='
WHERE
key_id = '1418ae9052d9e27e6e80cc4738560e3e19b7c68190a21dc6102a33176bba8bd5'
AND (
token = 'WSTs5sPBhPEcJc4eBIY5xO8jsEDgW2ZR2s8gGy+UC94='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)