UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uDsqUEol2WNQr8ctR2U1hwr/izhgCQMRLR1eXVMa9GA=' 
WHERE 
  key_id = 'a3e1c83ed33098e4e115f6094b32bf1891d92295fa2ed4e4ffc134e8f4178153' 
  AND (
    token = 'uDsqUEol2WNQr8ctR2U1hwr/izhgCQMRLR1eXVMa9GA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049