UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Pn/ym6vI3EjZZi+ArnzkBD7ycO1B+xeSnOrqDzknF7I=' 
WHERE 
  key_id = '34ba8e7e7c71e0ee0ff1488de548b37fd36c07eb8cf23c39165b368f7d727dc5' 
  AND (
    token = 'Pn/ym6vI3EjZZi+ArnzkBD7ycO1B+xeSnOrqDzknF7I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033