UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eHx/d/Nn0oNvZYOlklUQjrLGzapi0qMwO16nAQljR64='
WHERE
key_id = 'fec8d3e18e4481f744ca76b982edf8c17c5b67eda4d9a5600b63df5610fa307c'
AND (
token = 'eHx/d/Nn0oNvZYOlklUQjrLGzapi0qMwO16nAQljR64='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)