UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IovE39obVmMGFP5xjRQQ8uMfXke+z3l6iwHQaP5JyQo='
WHERE
key_id = 'bb033a6c8cc67aa7b500ed058e8a2c8795fbc8040e0e5667de10a4ca623aa44c'
AND (
token = 'IovE39obVmMGFP5xjRQQ8uMfXke+z3l6iwHQaP5JyQo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)