UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l6XJ9Ll4Atoc2MBPXHeqK4i8CAdvt+VvFXuAdB7FXuc='
WHERE
key_id = 'f266eb0d20c7bf1354aaea003920c85405fad9038c2badffd3bbab94d6f84985'
AND (
token = 'l6XJ9Ll4Atoc2MBPXHeqK4i8CAdvt+VvFXuAdB7FXuc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)