UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DenK/3s+fSv4PjQ3t1G4YF1R3oW0iBnqD51aHZ/oFzs='
WHERE
key_id = '819d54c6a2b3fb7bf36e8d43f620060fc15d639b56254c41451fb1a1d9a2c8af'
AND (
token = 'DenK/3s+fSv4PjQ3t1G4YF1R3oW0iBnqD51aHZ/oFzs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)