UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dUOxbCML3Nb7aJrM6UWcBoB7SCDJvXnppCorPFsQ0Oc=' 
WHERE 
  key_id = 'b568d389c9884030c3ebda2fc00e799bdcc5ce45f838df86fbdb31debf0e83b8' 
  AND (
    token = 'dUOxbCML3Nb7aJrM6UWcBoB7SCDJvXnppCorPFsQ0Oc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036