UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NvmgHxWTEjHqj7Y8sCFDlc1PxbSDQfYoA/6lyIBbcaw=' 
WHERE 
  key_id = '86fa63cd7af37c146045aadda464a435f756a02eceb2a74a062a6c9a1ab2666b' 
  AND (
    token = 'NvmgHxWTEjHqj7Y8sCFDlc1PxbSDQfYoA/6lyIBbcaw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027