UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WJ14kRYLdN1RA6JktM/gISl5P/lyGBPc8XQ4nG33WKo='
WHERE
key_id = '6b061da25a049747561b0ae16667d4e6c5a753a4abb445fbda245618757debe3'
AND (
token = 'WJ14kRYLdN1RA6JktM/gISl5P/lyGBPc8XQ4nG33WKo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)