UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rA92ZMdFTuUrbO/0WFQMR+U1anq4va4YDH6WZMZ7R7o='
WHERE
key_id = '0b25913fde2dcf84a555ee0976cc9e3fbe47b011f6f55b10b435379e0b8028a6'
AND (
token = 'rA92ZMdFTuUrbO/0WFQMR+U1anq4va4YDH6WZMZ7R7o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)