UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'puNSpTPPccYZ//SYr3zWkDJQ7ZBKi3g5JknlYtuafI8=' 
WHERE 
  key_id = '934baded83758d0f7c7358455cbeb507b573abb846c2b0a21baca5758ff84e5f' 
  AND (
    token = 'puNSpTPPccYZ//SYr3zWkDJQ7ZBKi3g5JknlYtuafI8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032