UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '51GPOCRAnnrliOZTE7iri7o2yL0TW4WFXLd9oxv8/oc='
WHERE
key_id = '49da112dfad91c3dfb15acfd4171dee2eb0489f53ab15b59384f8aef068b9e22'
AND (
token = '51GPOCRAnnrliOZTE7iri7o2yL0TW4WFXLd9oxv8/oc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)