UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vUoM4JCMuRs/zorl4+zCzMFy9ZmBWglXGqKvzpHlIGQ=' 
WHERE 
  key_id = '1df039ba5cc85b022fa91b5fdadc943f54afacf4f56fe764c9aa77a83d15d030' 
  AND (
    token = 'vUoM4JCMuRs/zorl4+zCzMFy9ZmBWglXGqKvzpHlIGQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021