UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ak5H7f5n4S6OSiR74jj611y59Z7/rERU9/r6NwK6u6Q='
WHERE
key_id = '25b22f545f3ada71db487014a551ce53d0f3cb3385e9325889017708b1ceaafd'
AND (
token = 'Ak5H7f5n4S6OSiR74jj611y59Z7/rERU9/r6NwK6u6Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)