UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'z0lN/WtvS0vnd3YmkaALMce0JXyJz4dB9R3bw0+vTQc='
WHERE
key_id = '8070e9fea3ba836fc81193d01d43c0effdd9e413691190b9e6dc16f90b0c67ae'
AND (
token = 'z0lN/WtvS0vnd3YmkaALMce0JXyJz4dB9R3bw0+vTQc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)