UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qbKo7i0oG75gNrYPDyYn4FWeqPHq1FaPf9y6ylhykIE=' 
WHERE 
  key_id = '0011be5baefedc2cb3d50fce3f82ad202e6572eb3277a937916a92a924fe8265' 
  AND (
    token = 'qbKo7i0oG75gNrYPDyYn4FWeqPHq1FaPf9y6ylhykIE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029