UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZIkZ+WGdftuLT7IMBmiFKGuTkBaQM/msz1iDBl6PDFM='
WHERE
key_id = '2d92fff00b7adfeb6a5b0b384685e8db333301076baa6e3ce7e279a93ad9ae24'
AND (
token = 'ZIkZ+WGdftuLT7IMBmiFKGuTkBaQM/msz1iDBl6PDFM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)