UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xtF7vZmbSesO+dWjB7tEf5LP/B7/bLpF5hXS7pOfOLA=' 
WHERE 
  key_id = 'bebdd22bec87c3d6f798a8b6a71bde2e38c470ecf51cc271199baa304e8cfb6f' 
  AND (
    token = 'xtF7vZmbSesO+dWjB7tEf5LP/B7/bLpF5hXS7pOfOLA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038