UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mpVATKnYfQ5DF7pa+ey3fvQrgYzVHe64Xkew4K13rAU=' 
WHERE 
  key_id = 'a9263cd5ed3ef0ab3413bfe257332709cfb4396fa9fecdb74839e0a5c9f56dd5' 
  AND (
    token = 'mpVATKnYfQ5DF7pa+ey3fvQrgYzVHe64Xkew4K13rAU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043