UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nS9F7yFcEUDdpCxBZy3xWJBmAnxytam8fHNYAOqBo8o='
WHERE
key_id = '1c2189ab5338c364d2fbda93f8fdc3d5d09adf5fa5e1c00c285caa5f0c83e929'
AND (
token = 'nS9F7yFcEUDdpCxBZy3xWJBmAnxytam8fHNYAOqBo8o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)