UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6Gn73sH3B2TQbTxJNo8szOB++6mcJdls/z0zBh7K+g4='
WHERE
key_id = '2ffa15ba80407cb99c92fa5b78a007618b18de3e902def6e774073b30a2439a7'
AND (
token = '6Gn73sH3B2TQbTxJNo8szOB++6mcJdls/z0zBh7K+g4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)