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